local antiLag_settings = {
	status		= "on",
	farClipDist	= 198,
	gfx_table	= {
		"sm_des_bush2",
		"sm_des_bush3",
		"shad_car",
		"sm_des_bush1",
		"newtreeleaves128",
		"cloudmasked",
		"coronastar",
		"splash_up1",
		"splash_up2",
	}
}

addEventHandler("onClientResourceStart", resourceRoot,
	function()
		SHADER_FPS = dxCreateShader("texture/shader.fx")
		TEXTURE_FPS = dxCreateTexture("texture/invisible.png")
		if (SHADER_FPS and TEXTURE_FPS) then
			dxSetShaderValue(SHADER_FPS, "Tex0", TEXTURE_FPS)
		end
	end
)

	function enablewood(x,bool)
        if bool == true then
			
			setFarClipDistance(antiLag_settings.farClipDist)
			setFogDistance(antiLag_settings.farClipDist)
			setCloudsEnabled(false)
			setBirdsEnabled(false)
			setOcclusionsEnabled(false)
			
			for index, shader in pairs(antiLag_settings.gfx_table) do
				engineApplyShaderToWorldTexture(SHADER_FPS, tostring(shader))
			end
		else
			
			setOcclusionsEnabled(true)
			resetFarClipDistance()
			resetFogDistance()
			setCloudsEnabled(true)
			setBirdsEnabled(true)
			
			for index, shader in pairs(antiLag_settings.gfx_table) do
				engineRemoveShaderFromWorldTexture(SHADER_FPS, tostring(shader))
			end
		end
	end